<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template match="/">
		<html>
			<body>
				<table class="table table-striped">
					<thead>
						<tr>
							<th>Name</th>
							<th>Director</th>
							<th>Year</th>
							<th>Genre</th>
							<th>Id</th>
							<th>Rent</th>
						</tr>
					</thead>
					<tbody>
						<xsl:for-each select="movies/movie">
							<tr>
								<td>
									<xsl:value-of select="name" />
								</td>
								<td>
									<xsl:for-each select="director">
										<xsl:value-of select="." />
										,
									</xsl:for-each>
								</td>
								<td>
									<xsl:value-of select="year" />
								</td>
								<td>
									<xsl:for-each select="genre">
										<xsl:value-of select="." />
										,
									</xsl:for-each>
								</td>
								<td>
									<xsl:value-of select="@id" />
								</td>
								<td>
									<button class="btn btn-info">
								  		<xsl:attribute name="filmId">
							    			<xsl:value-of select="@id"/>
									  	</xsl:attribute>
									  	
									  	<xsl:text>Add</xsl:text>
								  	</button>
								</td>
							</tr>
						</xsl:for-each>
					</tbody>
				</table>
			</body>
		</html>
	</xsl:template>
</xsl:stylesheet>